<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>首页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${base}/static/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all" />
    <link rel="stylesheet" href="${base}/static/css/main.css" media="all" />
</head>
<body class="childrenBody">
<div class="panel_box row">
    <#if (userMenu?size>0)>
        <#list userMenu as items>
            <div class="panel col <#if (!items_has_next)>max_panel</#if> ">
                <a href="javascript:" data-url="${base}${items.href}">
                    <div class="panel_icon" <#if (items.bgColor != "")>style="background-color: ${items.bgColor}"<#else>style="background-color: #54ade8"</#if>>
                        <i class="layui-icon" data-icon="${items.icon}">${items.icon}</i>
                    </div>
                    <div class="panel_word newMessage">
                        <span>${items.dataCount}</span>
                        <cite>${items.name}</cite>
                    </div>
                </a>
            </div>
        </#list>
    </#if>
</div>
<div class="layui-fluid" style="padding: 0px">
    <div class="layui-row">
        <div class="layui-col-md6">
            <div id="container" style="height: 500px;background-color: #f2f2f2;border-radius: 5px;"></div>
            <script type="text/javascript" src="${base}/static/js/jquery.min.js"></script>
            <script type="text/javascript" src="${base}/static/js/echarts.min.js"></script>
            <script type="text/javascript">
                var dom = document.getElementById("container");
                var myChart = echarts.init(dom);

                var dateArray = [];
                var dt = [];
                $.get('${base}/admin/system/log/pvs').done(function (res) {
                    $.each( res.data, function(i, val ) {
                        dateArray.push(val.days)
                        dt.push(val.total)
                    });
                    window.onresize = myChart.resize;
                    myChart.setOption({
                        tooltip : {
                            trigger: 'axis',
                            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                            }
                        },
                        grid: {
                            top:'10%',
                            left: '5%',
                            right: '3%',
                            bottom: '5%',
                            containLabel: true,
                        },
                        xAxis: {
                            name:'近15天不重复ip访问浏览数/天',
                            type: 'category',
                            data: dateArray,
                            splitLine: {show:false},
                            nameLocation :'center',
                            nameGap:30,
                        },
                        yAxis: {
                            type: 'value',
                            name: '访问数/次',
                        },
                        series: [{
                            data: dt,
                            type: 'bar',
                            name: '日流量',
                            label:{
                                normal:{
                                    show:true,
                                    postion:'inside'
                                }
                            },
                            markPoint : {
                                data : [
                                    {type : 'max', name: '最大值'},
                                    {type : 'min', name: '最小值'}
                                ]
                            }
                        }]
                    });
                });
            </script>
        </div>
        <div class="layui-col-md5"></div>
    </div>
</div>
<script type="text/javascript" src="${base}/static/layui/layui.js"></script>
<script>
    layui.use(['layer','jquery','form'],function(){
        var layer = layui.layer,
                $ = layui.jquery,
                form = layui.form;

        $(".panel a").on("click",function(){
            window.parent.addTab($(this));
        });
    });
</script>
</body>
</html>